import Axios from 'axios'
const instance = Axios.create({
  baseURL: 'http://localhost:8081/images',
  timeout: 2000,
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})

class ImageUploadService {
  static async upload(data: File) {
    const fd = new FormData();
    fd.append("file", data);
    await instance.post('/', fd)
  }
}

export default ImageUploadService